-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support for description completionItem #724
Conversation
@Enaium could you please do 2 screenshots (with and without your PR) to show the result of completion item please. |
@@ -165,7 +165,8 @@ public String getItemText(@NotNull CompletionItem item) { | |||
*/ | |||
@Nullable | |||
public String getTypeText(CompletionItem item) { | |||
return item.getDetail(); | |||
var labelDetails = item.getLabelDetails(); | |||
return labelDetails != null ? labelDetails.getDescription() : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about labelDetails == null ? item.getDetail() : labelDetails.getDescription();
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -165,7 +165,8 @@ public String getItemText(@NotNull CompletionItem item) { | |||
*/ | |||
@Nullable | |||
public String getTypeText(CompletionItem item) { | |||
return item.getDetail(); | |||
var labelDetails = item.getLabelDetails(); | |||
return labelDetails != null ? labelDetails.getDescription() : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Enaium I have tested your PR with other language server like TypeScript, Go etc which doesn't support label detail and the renderer is bad:
The detail
in this case must be displayed on the right (like vscode does). Please change with
return labelDetails != null ? labelDetails.getDescription() : item.getDetail();
@@ -199,7 +200,7 @@ public boolean isStrikeout(@NotNull CompletionItem item) { | |||
@Nullable | |||
public String getTailText(@NotNull CompletionItem item) { | |||
var labelDetails = item.getLabelDetails(); | |||
return labelDetails != null ? labelDetails.getDetail() : null; | |||
return labelDetails != null ? labelDetails.getDetail() : item.getDetail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the original code like:
return labelDetails != null ? labelDetails.getDetail() : null;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it is not resolved, please keep the original code:
return labelDetails != null ? labelDetails.getDetail() : null;
@Enaium once you will do the fix for #724 (comment) I'm OK to merge your PR. |
3b12c2f
to
29fa77f
Compare
Thanks @Enaium ! |
@Enaium you can install nightly-builds and enjoy with your fix. |
Ok |
No description provided.